package com.fwj.portal.dao.notice;

import com.fwj.portal.entity.notice.Notice;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.sql.Timestamp;
import java.util.List;

/**
 * @Author: fwj
 * @Data: 2022/4/24 0:30
 * @Version 1.0
 * @Description:
 */


public interface NoticeMapper extends Mapper<Notice> {

    @Select(value =
            "SELECT " +
                    "notice_number noticeNumber, " +
                    "title " +
                    "FROM notice " +
                    "WHERE " +
                    "release_date <= #{releaseDate} " +
                    "AND " +
                    "status = #{status} " +
                    "ORDER BY " +
                    "level ASC, " +
                    "release_date DESC " +
                    "limit #{page},#{size}")
    List<Notice> selectNoticeListAndOrderByLevel(Timestamp releaseDate, String status,Integer page, Integer size);
}
